<?php
defined('_JEXEC') or die;

class AppcategorysController extends JControllerLegacy
{

	protected $default_view = 'appcategorys';
	
	public function display($cachable = false, $urlparams = false)
	{
		// Load the submenu.
		AppcategorysHelper::addSubmenu(JRequest::getCmd('view', 'appcategorys'));

		$view		= JRequest::getCmd('view', 'appcategorys');
		$layout 	= JRequest::getCmd('layout', 'appcategorys');
		$id			= JRequest::getInt('id');

		// Check for edit form.
		if ($view == 'appcategory' && $layout == 'edit' && !$this->checkEditId('com_appcategorys.edit.appcategory', $id)) {
		
                        // Somehow the person just went to the form - we don't allow that.
			$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
			$this->setMessage($this->getError(), 'error');
                      
			$this->setRedirect(JRoute::_('index.php?option=com_appcategorys&view=appcategorys', false));
                            
			return false;
		}

		parent::display();

		return $this;
	}
	
	
}
